<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{oldInvoiceBean.id}"/>
		<f:event type="preRenderView" listener="#{oldInvoiceBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Old Invoice"/>

	<ui:define name="header">
		Old Invoice
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty oldInvoiceBean.id}">
				Edit existing Old Invoice
			</c:when>
			<c:otherwise>
				Create a new Old Invoice
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="oldInvoiceBeanOldInvoiceRegNum" value="Reg Num:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceRegNum" maxLength="20" required="true" value="#{oldInvoiceBean.oldInvoice.regNum}"/>
					<h:message for="oldInvoiceBeanOldInvoiceRegNum" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceSaleDate" value="Sale Date:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceSaleDate" maxLength="20" value="#{oldInvoiceBean.oldInvoice.saleDate}"/>
					<h:message for="oldInvoiceBeanOldInvoiceSaleDate" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceInvCode" value="Inv Code:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceInvCode" maxLength="20" value="#{oldInvoiceBean.oldInvoice.invCode}"/>
					<h:message for="oldInvoiceBeanOldInvoiceInvCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceSaleAmt1" value="Sale Amt 1:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceSaleAmt1" value="#{oldInvoiceBean.oldInvoice.saleAmt1}"/>
					<h:message for="oldInvoiceBeanOldInvoiceSaleAmt1" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceSaleAmt" value="Sale Amt:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceSaleAmt" value="#{oldInvoiceBean.oldInvoice.saleAmt}"/>
					<h:message for="oldInvoiceBeanOldInvoiceSaleAmt" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceVatamt" value="Vatamt:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceVatamt" value="#{oldInvoiceBean.oldInvoice.vatamt}"/>
					<h:message for="oldInvoiceBeanOldInvoiceVatamt" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceCost" value="Cost:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceCost" maxLength="15" value="#{oldInvoiceBean.oldInvoice.cost}"/>
					<h:message for="oldInvoiceBeanOldInvoiceCost" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceCombackd" value="Combackd:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceCombackd" maxLength="20" value="#{oldInvoiceBean.oldInvoice.combackd}"/>
					<h:message for="oldInvoiceBeanOldInvoiceCombackd" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceCcomback" value="Ccomback:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceCcomback" maxLength="50" value="#{oldInvoiceBean.oldInvoice.ccomback}"/>
					<h:message for="oldInvoiceBeanOldInvoiceCcomback" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceCloseday" value="Closeday:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceCloseday" maxLength="20" value="#{oldInvoiceBean.oldInvoice.closeday}"/>
					<h:message for="oldInvoiceBeanOldInvoiceCloseday" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAname1" value="Aname 1:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAname1" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aname1}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAname1" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAname2" value="Aname 2:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAname2" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aname2}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAname2" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAname3" value="Aname 3:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAname3" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aname3}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAname3" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAtel1" value="Atel 1:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAtel1" maxLength="50" value="#{oldInvoiceBean.oldInvoice.atel1}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAtel1" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAadd1" value="Aadd 1:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAadd1" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aadd1}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAadd1" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAadd2" value="Aadd 2:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAadd2" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aadd2}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAadd2" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAadd3" value="Aadd 3:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAadd3" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aadd3}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAadd3" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAadd4" value="Aadd 4:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAadd4" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aadd4}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAadd4" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAadd5" value="Aadd 5:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAadd5" maxLength="10" value="#{oldInvoiceBean.oldInvoice.aadd5}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAadd5" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAcardNum" value="Acard Num:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAcardNum" maxLength="20" value="#{oldInvoiceBean.oldInvoice.acardNum}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAcardNum" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAoffice" value="Aoffice:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAoffice" maxLength="50" value="#{oldInvoiceBean.oldInvoice.aoffice}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAoffice" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAtel2" value="Atel 2:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAtel2" maxLength="50" value="#{oldInvoiceBean.oldInvoice.atel2}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAtel2" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceErrcode" value="Errcode:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceErrcode" maxLength="50" value="#{oldInvoiceBean.oldInvoice.errcode}"/>
					<h:message for="oldInvoiceBeanOldInvoiceErrcode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceOldreg" value="Oldreg:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceOldreg" maxLength="50" value="#{oldInvoiceBean.oldInvoice.oldreg}"/>
					<h:message for="oldInvoiceBeanOldInvoiceOldreg" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceRemainx" value="Remainx:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceRemainx" value="#{oldInvoiceBean.oldInvoice.remainx}"/>
					<h:message for="oldInvoiceBeanOldInvoiceRemainx" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceAmtnum" value="Amtnum:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceAmtnum" value="#{oldInvoiceBean.oldInvoice.amtnum}"/>
					<h:message for="oldInvoiceBeanOldInvoiceAmtnum" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="oldInvoiceBeanOldInvoiceCarType" value="Car Type:"/>
				<h:panelGroup>
					<h:inputText id="oldInvoiceBeanOldInvoiceCarType" maxLength="10" value="#{oldInvoiceBean.oldInvoice.carType}"/>
					<h:message for="oldInvoiceBeanOldInvoiceCarType" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{oldInvoiceBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty oldInvoiceBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{oldInvoiceBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{oldInvoiceBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>